package com.neuedu.mblog.controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

/**
 * 项目：mblog_java4
 * 创建时间：  2022-01-05   10:55
 * 作者 :jshand
 * 描述 : 退出
 */
@WebServlet(urlPatterns = "/logout")
public class LogoutController extends  BaseController{

    @Override
    protected void list(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, ClassNotFoundException {
        request.getSession().invalidate();//注销session

        response.sendRedirect(request.getContextPath()+"/home");

    }
}
